<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <h1>对象列表</h1>
  <ul id="show">

  </ul>
  <script src="./javascripts/jquery-3.4.1.min.js"></script>
  <script>
    //调用users下的/list接口 获取所有对象表的数据 并渲染
    $.ajax({
      url: "http://127.0.0.1:3000/users/list",
      type: "get",
      data: {},
      success: function (res) {
        console.log(res)
        var str = ``
        $.each(res, function (index, ele) {
          str += `  <li><span>${ele.name}</span>---------- <span>${ele.age}</span></li>`
        })
        $("#show").html(str)
      }
    })





  </script>
</body>

</html>